﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ENG.TeachersDiary.Model;

namespace ENG.TeachersDiary.Forms
{
  public partial class FrmMeanMeanings : Form
  {
    DiaryDB db;

    public FrmMeanMeanings()
    {
      InitializeComponent();
    }

    private void FrmMeanMeanings_Load(object sender, EventArgs e)
    {
      ReDB();
    }

    private void ReDB()
    {
      Common.CurrentMeanMeanings = null;

      db = Common.DBConn;

      meanMeaningBindingSource.DataSource = db.MeanMeanings.OrderBy(i => i.MaxMeanValue);
    }

    private void FrmMeanMeanings_FormClosing(object sender, FormClosingEventArgs e)
    {
      db.SubmitChanges();
    }
  }
}
